import axios from './api'


export const get = (url, mes) => {
  let params = mes ? mes : {};
  return axios({
    url,
    baseURL: "https://apis.map.qq.com",
    method: "get",
    params,
  });
}

export const post = (url, mes, mode) => {
  let data = mes ? mes : {};
  let headers = mode == 'json' ? { "Content-type": 'application/json' } : mode == 'file' ? { "Content-type": "multipart/form-data" } : { "Content-type": 'application/x-www-form-urlencoded' }
  return axios({
    url,
    method: 'post',
    data,
    headers,
  })
}

export const fetch = (myConfig) => {
  return axios(myConfig)
}

export default {
  fetch,
  get,
  post,
}
